<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <h2 id="app"></h2>
  <input type="text" id="todo-input">
  <script>
  var app = document.getElementById('app')
  var todoInput = document.getElementById('todo-input')

  todoInput.addEventListener('input', function(event) {
    var val = event.target.value
    console.log(val, todoInput.value, this.value);
    app.innerText = val
  })
  </script>
</body>
</html>